Ext.define('yiyuan.view.Erjimap', {
    extend: 'Ext.Panel',
    xtype: 'erjimapView',
    config: {
        layout: "vbox",
        scrollable:true,
        items: [
            {
                docked: 'top',
                xtype: 'toolbar',
                title: "",
                items: [
                    {
                        xtype: "button",
                        iconCls: "btn_home",
                        handler: function () {
                            Ext.Viewport.setActiveItem("main")
                        }
                    }
                ]
            },
            {
                xtype: "img",
                width:"100%",
                src:"",
                flex:1
            },
            {
                xtype: "panel",
                cls:"main_bottom",
                docked:"bottom",
                id:"map_bottom_panel",
                scrollable: null,
                html:"<div class='imgDiv3'><img src='resources/images/btn_map.png' alt='map' onclick='gotoSanjiMap(this)'/ ></div>" +
                    "<div class='imgDiv3'><img src='resources/images/btn_floor.png' alt='floor' onclick='gotoSanjiMap(this)'/ ></div>" +
                    "<div class='imgDiv3'><img src='resources/images/btn_commercial.png' alt='commercial' onclick='gotoSanjiMap(this)'/ ></div>"/*,
                listeners:{
                    painted:function(p){
                        p.on("tap",function(e){
                            var stb=Ext.create("yiyuan.view.SanjiMap");
                            console.log(e.target.alt)
                            if(e.target.alt=='map'){
                                stb.down("toolbar").setTitle("医院地图导航");
                                stb.down("img").setSrc("resources/images/5-2.png");
                            }
                            if(e.target.alt=='floor'){
                                stb.down("toolbar").setTitle("医院平面图");
                                stb.down("img").setSrc("resources/images/5-3.png");
                            }
                            if(e.target.alt=='commercial'){
                                stb.down("toolbar").setTitle("周边导航");
                                stb.down("img").setSrc("resources/images/5-4.png");
                            }
                            Ext.Viewport.setActiveItem(stb);
                        })
                    }
                }*/
            }
        ],
        listeners: {
            initialize: function () {
                var clientHeight = document.body.clientHeight;
                var c = clientHeight - 46;
                Ext.getCmp('map_bottom_panel').setHeight(c * 0.1);
            },
            deactivate: function () {
                clearInterval(si);
            }
        }
    }

});
